package com.ziven.common.widget.title;

import android.view.View;

import androidx.annotation.NonNull;

import com.ziven.common.widget.R;
import com.ziven.common.widget.value.Background;
import com.ziven.common.widget.value.Listener;
import com.ziven.common.widget.value.Navigation;
import com.ziven.common.widget.value.TakeEffect;
import com.ziven.common.widget.value.TextColor;
import com.ziven.common.widget.value.TitleMarginNav;
import com.ziven.common.widget.value.TitleSize;
import com.ziven.common.widget.value.Value;

/**
 * @author Ziven
 */
public interface TitleEffect extends BaseEffect<TitleView> {

    /**
     * Obtain Value
     * @return Value
     */
    @NonNull
    @Override
    default Value obtainValue() {
        return TakeEffect.values(
                Background.colorId(R.color.common_background_color).setId("TitleBackground"),
                Navigation.drawableId(R.drawable.drawable_setting_title__back).setId("TitleBackIcon"),
                TextColor.colorId(R.color.common_title_enable_color).setId("TitleColor"),
                TitleSize.dimenId(R.dimen.common_title_size).setId("TitleSize"),
                TitleMarginNav.margin(0).setId("TitleMarginNav"),
                Listener.listener((View.OnClickListener) v -> obtainActivityBack().run()).setId("TitleBackListener")
        );
    }
}
